/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clienttest.object;

import java.text.DecimalFormat;
import java.util.Locale;

/**
 *
 * @author lekhanhduy
 */
public class CreditCard {

    public static final String AccountCode = "accountCode";
    public static final String AccountPass = "accountPass";
    public static final String Balance = "balance";
    //user
    public static final String IdentityCardNumber = "identityCardNumber";
    public static final String FirstName = "firstName";
    public static final String LastName = "lastName";
    public static final String DateOfBirth = "dateOfBirth";
    public static final String Phone = "phone";
    public static final String Email = "email";
    public static final String Address = "address";
    public static final String StaffBank = "staffBank";
    //param
    private String accountCode;
    private String accountPass;
    private double balance;
    private String identityCardNumber;
    private String firstName;
    private String lastName;
    private String dateOfBirth;
    private String phone;
    private String email;
    private String address;
    private Boolean staffBank;

    /**
     * @return the accountCode
     */
    public String getAccountCode() {
        return accountCode;
    }

    /**
     * @param accountCode the accountCode to set
     */
    public void setAccountCode(String accountCode) {
        this.accountCode = accountCode;
    }

    /**
     * @return the accountPass
     */
    public String getAccountPass() {
        return accountPass;
    }

    /**
     * @param accountPass the accountPass to set
     */
    public void setAccountPass(String accountPass) {
        this.accountPass = accountPass;
    }

    /**
     * @return the balance
     */
    public double getBalance() {
        return balance;
    }

    /**
     * @param balance the balance to set
     */
    public void setBalance(double balance) {
        this.balance = balance;
    }

    /**
     * @return the identityCardNumber
     */
    public String getIdentityCardNumber() {
        return identityCardNumber;
    }

    /**
     * @param identityCardNumber the identityCardNumber to set
     */
    public void setIdentityCardNumber(String identityCardNumber) {
        this.identityCardNumber = identityCardNumber;
    }

    /**
     * @return the firstName
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * @param firstName the firstName to set
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * @return the lastName
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * @param lastName the lastName to set
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * @return the dateOfBirth
     */
    public String getDateOfBirth() {
        return dateOfBirth;
    }

    /**
     * @param dateOfBirth the dateOfBirth to set
     */
    public void setDateOfBirth(String dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    /**
     * @return the phone
     */
    public String getPhone() {
        return phone;
    }

    /**
     * @param phone the phone to set
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the address
     */
    public String getAddress() {
        return address;
    }

    /**
     * @param address the address to set
     */
    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "Tài khoản : " + getAccountCode() + "\n"
                + "Số dư chính : " + (DecimalFormat.getCurrencyInstance(Locale.US).format(getBalance())).replace("$"," ") + " VNĐ" + "\n"
                + "Họ và tên : " + getFirstName() + " " + getLastName() + "\n"
                + "Ngày sinh : " + getDateOfBirth() + "\n"
                + "Điện thoại : " + getPhone() + "\n"
                + "Email : " + getEmail() + "\n"
                + "Địa chỉ : " + getAddress();
    }

    public String toStringStaff() {
        return "Nhân viên : " + getFirstName() + " " + getLastName() + "\n"
                + "Ngày sinh : " + getDateOfBirth() + "\n"
                + "Điện thoại : " + getPhone() + "\n"
                + "Email : " + getEmail();
    }

    /**
     * hàm này check xem số tiền rút có hợp lệ hay không
     */
    public boolean checkMonney(double money) {
        if (money > 0 && money % 10000 == 0) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * @return the staffBank
     */
    public Boolean getStaffBank() {
        return staffBank;
    }

    /**
     * @param staffBank the staffBank to set
     */
    public void setStaffBank(Boolean staffBank) {
        this.staffBank = staffBank;
    }
}
